﻿using Coldairarrow.Entity.DTO;
using Coldairarrow.Entity.PB;
using Coldairarrow.Util;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace Coldairarrow.Business.PB
{
    public partial interface IPB_ProjectBusiness
    {
        Task AddDataExlAsync(List<PB_Project> list);
        Task AddDataExlAsyncLou(List<PB_Buildingnumber> list);
        int UpdatePB_Buildingnumber(string Buildingnumber, string ProjectId);
        Task<PageResult<PB_ProjectDTO>> GetDataListAsync(PageInput<ConditionDTO> input);
        /// <summary>
        /// 获取项目列表
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        Task<PageResult<PB_ProjectDTO>> GetProjectItemAsync(PageInput<ConditionDTO> input);
        /*
         * 创建人：崔楠
         * 创建时间：2020-03-16 15:10
         * 描述：添加大屏项目接口
         */
        Task<PageResult<PB_ProjectDTO>> GetDataListNoTokenAsync(PageInput<ConditionDTO> input);
        /*
         * 创建人：崔楠
         * 创建时间：2020-03-30 14:46
         * 描述：添加大屏项目接口
         */
        Task<List<MaterialByLocaltion>> GetMaterialSumDataListAsync(string StorAreaName, List<string> RackName);
        /*
         * 创建人：崔楠
         * 创建时间：2020-03-13 10:58
         * 描述：添加大屏项目详情接口
         */
        Task<PageResult<ProjectInfoDTO>> GetProjectInfoDataListAsync(PageInput<ConditionDTO> input);
        Task<PageResult<ProjectInfoDTO>> GetProjectInfoDataListBySearchAsync(PageInput<ConditionDTO> input);
        Task<List<TreeDataDTO>> GetDataListInfo();
        Task<List<TreeDataStockDTO>> GetdeliverGoodsListInfo(string ObjectName);
        IQueryable<T> GetQueryable<T>() where T : class, new();
        Task<List<TreeDataDTO>> GetDataMainListInfo(string ObjectName);
        Task<PB_ProjectDTO> GetTheDataAsync(string id);
        Task AddDataAsync(PB_Project data);
        Task UpdateDataAsync(PB_Project data);
        Task DeleteDataAsync(List<string> ids);
        IQueryable<T> GetQueryableOK<T>() where T : class, new();
        /// <summary>
        /// 查看项目回货信息
        /// </summary>
        /// <param name="ProjectId">项目id</param>
        /// <returns></returns>
        Task<PageResult<EndReturnNums>> GetProjectListDataAsync(PageInput<EndReturnConditionDTO> input);

        /// <summary>
        /// 关闭项目接口
        /// </summary>
        /// <param name="ProjectId">项目id</param>
        /// <returns></returns>
        Task CloseProjectDataAsync(string ProjectId);

        /// <summary>
        /// 获取项目信息
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        Task<PageResult<PB_ProjectDTO>> GetProjectDataAsync(PageInput<ConditionDTO> input);

        /// <summary>
        /// 获取项目信息
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        Task<ProjectStatistics> projectStatisticsInfo(string projectId);
        /// <summary>
        /// 回货选择项目信息
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        Task<PageResult<PB_ProjectReturnDTO>> GetProjectReturnDataListAsync(PageInput<ProjectReturnConditionDTO> input);

        Task<PageResult<StatisticalData>> GetStatisticalDataAsync(PageInput<ProjectReturnConditionDTO> input);
        
        /// <summary>
        /// 根据当前登录人获取项目
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        Task<List<PB_ProjectBulidList>> GetProjectCurrentState();
        /// <summary>
        /// 根据当前登录人获取项目
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        /// 



        Task<PageResult<PB_ProjectStatuLogDto_>> GetProjectStatuLogList(PageInput<ProjectReturnConditionDTO> input, string ProjectId, string BuildingnumberId);

        Task<string> GetLocation(string lng, string lat);

        Task<List<PB_Buildingnumber>> GetBulidList(string ProjectId);
        /// <summary>
        /// 大屏显示在用机位总数
        /// </summary>
        /// <returns>机位总数</returns>
        ScreenDisplayValueDTO GetStandsNumberInUsed();
        /// <summary>
        /// 大屏显示已签合同未发货的机位数
        /// </summary>
        /// <returns>已签合同未发货的机位数</returns>
        ScreenDisplayValueDTO GetReadyDeliveryStandsNumber();

        /// <summary>
        /// 大屏展示在建项目总数
        /// </summary>
        /// <returns></returns>
        ScreenDisplayValue2DTO GetProjectsunder();

        /// <summary>
        /// 大屏显示未发货项目总数
        /// </summary>
        /// <returns></returns>
        ScreenDisplayValue2DTO GetTotalNumber();
        /// <summary>
        /// 大屏显示交付监控
        /// </summary>
        /// <returns>交付监控</returns>
        Task<List<PB_ProjectDeliveryMonitorDTO>> GetPB_ProjectDeliveryMonitor();
        /// <summary>
        /// 大屏显示爬架交付状态
        /// </summary>
        /// <returns>爬架交付状态</returns>
        Task<List<PB_ProjectSubmitStateDTO>> GetProjectSubmitState();
        /// <summary>
        /// 大屏显示回货项目数量
        /// </summary>
        /// <returns>回货项目数量</returns>
        ScreenDisplayValue2DTO GetReturnProjectNumber();
        /// <summary>
        /// 大屏显示物料回货百分比均值(先计算单品回货率，再求平均数)
        /// </summary>
        /// <returns>物料回货百分比均值</returns>
        ScreenDisplayValue3DTO GetReturnAverage();
        /// <summary>
        /// 大屏显示30天项目回货率(先计算单品回货率，再求平均数)，损坏率列表。
        /// </summary>
        /// <returns>30天项目回货率，损坏率</returns>
        Task<List<PB_ProjectReturnDestoriedRateDTO>> Get30DayReturnDestoriedRate();
        Task<List<PB_ProjectReturnDestoriedRateDTO>> Get30DayReturnDestoriedRate2();
        /// <summary>
        /// 大屏显示项目回货数据
        /// </summary>
        /// <returns></returns>
        Task<List<ProjectReturnScreen>> ProjectReturnScreensList();

        Task<List<DeliveredDeliveryrate>> GetD2(string ProjectId);
    }

    public class ProjectReturnConditionDTO
    {
        public string Condition { get; set; }
        public string Keyword { get; set; }

        public string UserId { get; set; }
    }

}